package com.hy.admin.entity;

import com.hy.admin.enums.EnumPayOrderStatus;
import com.hy.db.domain.BaseEntity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by wayne on 18/4/20.
 */
public class PayOrderEntity extends BaseEntity {
    /**
     * 会员ID
     */
    private String memberId;
    /**
     * 交易单号
     */
    private String orderNo;
    /**
     * 支付流水号(第三方流水号)
     */
    private String paymentSn;
    /**
     * 业务单号
     */
    private String outOrderNo;

    private Long outOrderId;
    /**
     * 1氧卡 2课程
     */
    private Integer outOrderType;
    /**
     * 支付金额
     */
    private BigDecimal payAmount;
    /**
     * 退款金额
     */
    private BigDecimal payRefundAmount;
    /**
     * 上游返回的支付url
     */
    private String payUrl;

    private String authCode;

    /**
     * 请求时间(请求第三方的时间)
     */
    private Date requestTime;

    /**
     * 支付完成时间（第三方返回的完成时间）
     */
    private Date finishTime;
    /**
     * 支付模式
     *
     */
    private int payMode;

    /**
     * 渠道订单号（汇宜通道展示给用户的交易单号）
     */
    private String channelId;

    /**
     * 上游通道方
     */
    private int payChannel;
    /**
     * 商品描述
     */
    private String goodsDescribe;

    /**
     * 支付账户名
     */
    private String payAccountName;

    /**
     * 支付账号(可能为空，如支付宝，实名，微信返回)
     */
    private String payAccount;
    /**
     * 渠道的原始的错误信息
     */
    private String message;

    /**
     * 备注
     */
    private String remarks;

    /**
     * 业务方回调地址
     */
    private String notifyUrl;

    /**
     * 查询次数
     */
    private int queryCount;

    //清算时间
    private Date settDt;

    private String memberMsg;
    private String requestIp;

    private String mchId;


    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getPaymentSn() {
        return paymentSn;
    }

    public void setPaymentSn(String paymentSn) {
        this.paymentSn = paymentSn;
    }

    public String getOutOrderNo() {
        return outOrderNo;
    }

    public void setOutOrderNo(String outOrderNo) {
        this.outOrderNo = outOrderNo;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public BigDecimal getPayRefundAmount() {
        return payRefundAmount;
    }

    public void setPayRefundAmount(BigDecimal payRefundAmount) {
        this.payRefundAmount = payRefundAmount;
    }

    public String getPayUrl() {
        return payUrl;
    }

    public void setPayUrl(String payUrl) {
        this.payUrl = payUrl;
    }

    public Date getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(Date requestTime) {
        this.requestTime = requestTime;
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public int getPayMode() {
        return payMode;
    }

    public void setPayMode(int payMode) {
        this.payMode = payMode;
    }

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public int getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(int payChannel) {
        this.payChannel = payChannel;
    }

    public String getGoodsDescribe() {
        return goodsDescribe;
    }

    public void setGoodsDescribe(String goodsDescribe) {
        this.goodsDescribe = goodsDescribe;
    }

    public String getPayAccountName() {
        return payAccountName;
    }

    public void setPayAccountName(String payAccountName) {
        this.payAccountName = payAccountName;
    }

    public String getPayAccount() {
        return payAccount;
    }

    public void setPayAccount(String payAccount) {
        this.payAccount = payAccount;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public int getQueryCount() {
        return queryCount;
    }

    public void setQueryCount(int queryCount) {
        this.queryCount = queryCount;
    }

    public Date getSettDt() {
        return settDt;
    }

    public void setSettDt(Date settDt) {
        this.settDt = settDt;
    }

    public String getMemberMsg() {
        return memberMsg;
    }

    public void setMemberMsg(String memberMsg) {
        this.memberMsg = memberMsg;
    }

    public String getAuthCode() {
        return authCode;
    }

    public void setAuthCode(String authCode) {
        this.authCode = authCode;
    }

    public String getRequestIp() {
        return requestIp;
    }

    public Long getOutOrderId() {
        return outOrderId;
    }

    public void setOutOrderId(Long outOrderId) {
        this.outOrderId = outOrderId;
    }

    public void setRequestIp(String requestIp) {
        this.requestIp = requestIp;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }


    public Integer getOutOrderType() {
        return outOrderType;
    }

    public void setOutOrderType(Integer outOrderType) {
        this.outOrderType = outOrderType;
    }

    public boolean ispaying() {
        if (this.status == EnumPayOrderStatus.DUE_PAY.getId() || this.status == EnumPayOrderStatus.PAYING.getId()) {
            return true;
        }
        return false;
    }
}
